
/*
* 初步封装按钮控件
* reClass用于覆盖默认样式
* 调用方法
* <ReButton reButtonClick={this.test} reClass="dark">testdsfds</ReButton>
* */
'use strict';
var React = require('react');
class ReButton extends React.Component {
    constructor(props) {
        super(props);
        this.getSpecialClass=this.getSpecialClass.bind(this);
    }

    //获取样式
    getSpecialClass(){
        if(this.props.reClass!=undefined){
            return "ReButton "+this.props.reClass;
        }
        else{
            return 'ReButton';
        }
    }

    render(){
        return (
            <button className={this.getSpecialClass()} onClick={this.props.reButtonClick}>{this.props.children}</button>
        );
    }
}

module.exports=ReButton;